/**
 * Copyright (c) "Neo4j"
 * Neo4j Sweden AB [https://neo4j.com]
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* eslint-disable @typescript-eslint/no-unused-vars */

import RxResult from '../../types/result-rx'

const dummy: any = null

const res: RxResult = dummy

const pushed: Promise<void> = res.push()
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
const paused: void = res.pause()
const resumed: Promise<void> = res.resume()

res.keys().subscribe({
  next: value => console.log(`keys: ${value.reduce((acc, curr) => acc + ', ' + curr, '')}`),
  complete: () => console.log('keys complete'),
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
  error: error => console.log(`keys error: ${error}`)
})

res.records().subscribe({
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions,@typescript-eslint/no-base-to-string
  next: value => console.log(`record: ${value}`),
  complete: () => console.log('records complete'),
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
  error: error => console.log(`records error: ${error}`)
})

res.consume().subscribe({
  // eslint-disable-next-line @typescript-eslint/no-base-to-string
  next: value => console.log(`summary: ${value.toString()}`),
  complete: () => console.log('summary complete'),
  // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
  error: error => console.log(`summary error: ${error}`)
})
